﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fetion.Util
{
   public class BitConvertHelper
    {
        private static  int BUFFER = 1024;

        public static byte[] getBytes(int i)
        {

            byte[] result = new byte[4];

            result[3] = (byte)((i >> 24) & 0xFF);
            result[2] = (byte)((i >> 16) & 0xFF);
            result[1] = (byte)((i >> 8) & 0xFF);
            result[0] = (byte)(i & 0xFF);

            return result;

        }

        public static byte[] getBytes(short i)
        {
            byte[] result = new byte[2];

            result[1] = (byte)((i >> 8) & 0xFF);
            result[0] = (byte)(i & 0xFF);

            return result;
        }
	
    }
}
